machine_specific_memory_setup() makes the following call to setup e820:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 14 Oct 2005 21:15:21 +0000 (22:15 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 14 Oct 2005 21:15:21 +0000 (22:15 +0100)
    add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);

Since max_pfn is (rightly) an unsigned long, we overflow for the current
definition of PFN_PHYS. Attached is my preferred solution as it will
hopefully avoid similar situations that may come up in the future.

Signed-off-by: srparish@us.ibm.com
linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h

index 5161768219359a335eec2e40b4000bda73d36223..5fd2eadc12250ab5cbffaa43d85544ac9a103af6 100644 (file)
@@ -8,7 +8,7 @@
 
 #define PFN_UP(x)      (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
 #define PFN_DOWN(x)    ((x) >> PAGE_SHIFT)
-#define PFN_PHYS(x)    ((x) << PAGE_SHIFT)
+#define PFN_PHYS(x)    ((unsigned long long)(x) << PAGE_SHIFT)
 
 /*
  * Reserved space for vmalloc and iomap - defined in asm/page.h